package com.qinbaokeji.checkpoint.dahuacamera.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author MP生成器
 * @since 2021-04-11
 */
@Data
@TableName("checkpoint_camera_info")
public class CameraInfo extends Model<CameraInfo> {

    private static final SimpleDateFormat FORMAT = new SimpleDateFormat ("yyyyMMddhhmmss");

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String uuid;

    private String username;

    private String password;

    private String ip;

    private Integer port;

    private String sendUrl;

    /**
     * 摄像机名称
     */
    private String name;

    /**
     * 服务端启动端口
     */
    private Integer serverPort;

    private Integer isListen;

    private Integer pid;

    public String logFileName(){
        return "log-"+name+"-"+FORMAT.format(new Date())+".log";
    }
}
